<template>
  <div>
    <el-pagination layout="prev, pager, next" :current-page ='currentPg' :total="total" :pageSize="pageSize" :pageCount="pageCount" @current-change="pageChange">
    </el-pagination>
  </div>
</template>

<script>
  export default {
    name: 'pagination',
    props: {
      total: {
        type: Number,
        default: 100
      },
      currentPg: {
        type: Number,
        default: 1
      },
      pageSize: {
        type: Number,
        default: 10
      },
      pageCount: {
        type: Number,
        default: 0
      },
      currentChange: {
        type: Function
      }
    },
    data() {
      return {}

    },
    methods: {
      pageChange: function (page) {

        this.$emit('currentChange', page);
      }
    }

  }

</script>
